<include file="public@header" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=8" >
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
<style type="text/css">

	.form-horizontal .control-label {width:150px;}
	input{width:100%; min-width:210px;}
	.checkbox-custom {
		position: relative;
		padding: 0 15px 0 25px;
		margin-bottom: 7px;
		margin-top: 0;
		display: inline-block;
	}
	/*
    将初始的checkbox的样式改变
    */
	.checkbox-custom input[type="checkbox"] {
		opacity: 0;/*将初始的checkbox隐藏起来*/
		position: absolute;
		cursor: pointer;
		z-index: 2;
		margin: -6px 0 0 0;
		top: 50%;
		left: 3px;
	}
	/*
    设计新的checkbox，位置
    */
	.checkbox-custom label:before {
		content: '';
		position: absolute;
		top: 50%;
		left: 0;
		margin-top: -9px;
		width: 19px;
		height: 18px;
		display: inline-block;
		border-radius: 2px;
		border: 1px solid #bbb;
		background: #fff;
	}
	/*
    点击初始的checkbox，将新的checkbox关联起来
    */
	.checkbox-custom input[type="checkbox"]:checked +label:after {
		position: absolute;
		display: inline-block;
		font-family: 'Glyphicons Halflings';
		content: "\e013";
		top: 42%;
		left: 3px;
		margin-top: -5px;
		font-size: 11px;
		line-height: 1;
		width: 16px;
		height: 16px;
		color: #333;
	}
	.checkbox-custom label {
		cursor: pointer;
		line-height: 1.2;
		font-weight: normal;/*改变了rememberme的字体*/
		margin-bottom: 0;
		text-align: left;
	}

</style>
<script type="text/javascript" src="__STATIC__/js/gaopaiyi/gpy.js?v={:time()}"></script>
</head>
<body onload="onLoad(1)" >
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:url('visua')}">{:lang('可视化墓区')}</a></li>
		<li><a href="{:url('sale')}?order_id={$order_id}">墓位信息</a></li>
		<li class="active"><a href="{:url('applyer')}?order_id={$order_id}">购墓人信息</a></li>
	</ul>
	<form class="form-horizontal ajax-form" action="{:url('applyer')}" method="post">
		<input type="hidden" name="order_id" value="{$order_id}" >
		<input type="hidden" name="customer_id" value="{$result.id|default=''}" >
		<fieldset>
			<div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;">
				<div class="form-group">
					<label class="control-label"><span class="form-required">*</span>客户账户（身份证号码）</label>
					<div class="col-lg-2" style="width: 18%;">
						<input type="text" class="form-control" id="customer_account" name="customer_account" placeholder="请输入身份证号码" value="{$result.customer_account|default=''}" >
						<button type="button"  class=" btn btn-info " id="singleReadIDCard"  >读取</button>
					</div>
						<input type="hidden" id="buyer_sex" name="buyer_sex" value="{$result.buyer_sex|default=''}">

					<label class="control-label" style="width: 125px;"><span class="form-required">*</span>证件类型</label>
					<div class="col-lg-2">
						<select name="cart_type" class="form-control">
							<if condition=" isset($result['cart_type'])">
								<option value="1" <if condition=" $result['cart_type'] eq 1"> selected </if>>身份证</option>
								<option value="2" <if condition=" $result['cart_type'] eq 2"> selected </if>>护照</option>
								<option value="3" <if condition=" $result['cart_type'] eq 3"> selected </if>>军人证</option>
								<else/>
								<option value="1">身份证</option>
								<option value="2">护照</option>
								<option value="3">军人证</option>
							</if>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" ><span class="form-required">*</span>购买人（注册人）</label>
					<div class="col-lg-2">
						<input type="text" class="form-control" name="buyer_name" id="buyer_name" value="{$result.buyer_name|default=''}"  placeholder="请输入注册人姓名（2-6字符）">
					</div>
					<label class="control-label"><span class="form-required">*</span>联系电话</label>
					<div class="col-lg-2">
						<input type="text" class="form-control" name="buyer_phone" id="buyer_phone" value="{$result.buyer_phone|default=''}" placeholder="请输入注册人联系电话">
					</div>
					<div class="col-lg-3">
						<php>$img_url=cmf_get_image_preview_url(isset($result['cart_upload'])?$result['cart_upload']:'');</php>
						<input type="hidden" name="cart_upload_id" id="cart_upload-file_id" value="{$result.cart_upload_id|default=''}">
						<input type="hidden" name="cart_upload" id="cart_upload" value="{$result.cart_upload|default=''}">
						<a href="javascript:gpyUploadOneImage('上传身份证', '#cart_upload','{$tomb_num}');">
							<h5 class="btn btn-primary">上传身份证</h5>
						</a>
						<img    src="{$img_url}" style="width: 36px"   onclick="parent.imagePreviewDialog(this.src);"  class="preview" id="cart_upload-preview" />
					</div>
				</div>
				<div class="form-group ">
					<label class="control-label"><span class="form-required">*</span>墓主</label>
					<div class="col-sm-2" style="width: 25%;">
						<if condition=" isset($result['is_show'])">
							<input type="text" class="form-control" name="purchased_name"  id="purchased_name"  <if condition=" $result['is_show'] eq 1"> disabled  </if>  value="{$result.purchased_name|default=''}"  placeholder="请输入墓主姓名（2-6字符）">
							<div class="checkbox-custom checkbox-default">
								<input type="checkbox" id="RememberMe" name="is_show" value="1"  <if condition=" $result['is_show'] eq 1"> checked  </if>>
								<label for="RememberMe">寿穴</label>
							</div>
						<else/>
							<input type="text" class="form-control" name="purchased_name"  id="purchased_name"    value="{$result.purchased_name|default=''}"  placeholder="请输入墓主姓名（2-6字符）">
							<div class="checkbox-custom checkbox-default">
								<input type="checkbox" id="RememberMe" name="is_show" value="1" >
								<label for="RememberMe">寿穴</label>
							</div>
						</if>
					</div>
					<div class="col-sm-2">
						<label class="control-label"></label>
					</div>
					<div class="col-sm-2">
						<php>$img_urls=cmf_get_image_preview_url(isset($result['purchased_file'])?$result['purchased_file']:'');</php>
						<input type="hidden" name="purchased_file_id" id="purchased_file-file_id" value="{$result.purchased_file_id|default=''}">
						<input type="hidden" name="purchased_file" id="purchased_file" value="{$result.cart_upload|default=''}">
						<a href="javascript:gpyUploadOneImage('上传身份证/火化证明', '#purchased_file','{$tomb_num}');">
							<h5   class="btn btn-primary">上传身份证/火化证明</h5>
						</a>
						<img style="width: 36px"  onclick="parent.imagePreviewDialog(this.src);" src="{$img_urls}" class="preview" id="purchased_file-preview" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label"><span class="form-required">*</span>第二联系人</label>
					<div class="col-lg-2">
						<input type="text" class="form-control" name="second_name" id="second_name" value="{$result.second_name|default=''}"  placeholder="请输入名称（2-6字符）">
						<input type="hidden" class="form-control" name="cart_ID"   value="{$result.cart_ID|default=''}"  >

					</div>
					<label class="control-label"><span class="form-required">*</span>第二联系人号码</label>
					<div class="col-lg-2">
						<input type="text" class="form-control" name="second_phone" id="second_phone" value="{$result.second_phone|default=''}" placeholder="请输入第二联系电话">
					</div>
				</div>
				<div class="form-group" style="width:100%;">
					<label class="control-label"><span class="form-required">*</span>客户详细地址</label>
					<div class="col-lg-4">
						<input type="text" style="min-width: 100%;" class="form-control" id="customer_address" name="customer_address" value="{$result.customer_address|default=''}" placeholder="请输入详细地址信息" >
						<!--                        <textarea name="customer_address" class="form-control" rows="4" style="width:595px; text-align:left;" placeholder="请输入详细地址信息">{$result.customer_address|default=''}</textarea>-->
					</div>
					<label class="control-label">导购员 </label>
					<div class="col-lg-4" style="">
						<input type="text" class="form-control" value="{$result.shoppingguide|default=''}"  disabled>
					</div>
				</div>
				<!--<if condition="$order_info.stages_num gt 1">-->
				<div class="form-group" >
					<label class="control-label">分期 </label>
					<div class="col-lg-4" style="">
						<!--<if condition="$order_info.stages_num gt 1">-->
						<input type="text" class="form-control" value="分{$order_info.stages_num}期支付"  disabled>
						<!--</if>-->
					</div>
				</div>
				<!--</if>-->
			</div>
		</fieldset>
		<div class="form-actions">
			<input type="hidden" name="dtype" value="0">
			<!--<if condition="$order_info.tomb_type neq 3">-->
				<!--<if condition="$dj_count eq 0">-->
					<!--<if condition="$order_info.tomb_type eq 2">-->
					<button type="submit"  class=" dingjin btn btn-primary ajax-submit">预付款</button>
					<!--<else />  -->
					<button type="submit"  class=" dingjin btn btn-primary ajax-submit">定金</button>
					<!--</if>-->
				<!--</if>-->
				<button type="submit" class="quan btn btn-primary ajax-submit">全款购买</button>
			<!--<else />  -->
				<button type="submit" class="quan btn btn-primary ajax-submit">全款购买</button>
			<!--</if>-->
			<!--<a class="btn" id="js-dialog-close"  href="{:url('orders/user')}">下一步</a>-->
		</div>
	</form>

</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>

<script>
	$('#singleReadIDCard').click(function () {
		ReadIDCard(1,function (json) {
			console.log(json)
			$('#customer_account').val(json.empIndentity);
			$('#buyer_name').val(json.empName);
			$('#customer_address').val(json.empRegisteredPlace);
			$('#buyer_sex').val(json.empSex);
			$.ajax({
				url: "{:url('user/asset/gaopaiyi')}",
				type: 'post',
				data:{path:"{$tomb_num}",pathbase64:json.fileBase64},
				success: function (data) {
					if (data.code==1){
						$('#cart_upload').val( data.data.filepath);
						$('#cart_upload-preview').attr('src', data.data.preview_url);
					}
				}
			})
		})
	})
	$('#RememberMe').click(function () {
		if($(this).is(":checked")){
			$('#purchased_name').attr('required',true)
			$('#purchased_name').attr('disabled',true)
		}else {
			$('#purchased_name').attr('disabled',false)
			$('#purchased_name').attr('required',false)
		}
	})
	$('.dingjin').click(function () {
		$('input[name=dtype]').val(1)
	})
	$('.quan').click(function () {
		$('input[name=dtype]').val(0)
	})
</script>

</body>
</html>